<?php
function get_teacher_list(){
	$query="SELECT * FROM user WHERE LEVEL=".TEACHER;
	$result=mysql_query($query);
	return $result;
}
	
function get_teacher_account($userid){
	$query="SELECT * FROM user WHERE USERID=$userid";
	$result=mysql_query($query);
	return $result;
}
function del_teacher_account($userid){
	$query="DELETE FROM schedule WHERE USERID IN (SELECT USERID FROM user WHERE USERGROUP=$userid)";
	mysql_query($query);
	
	$query="DELETE FROM report WHERE USERID IN (SELECT USERID FROM user WHERE USERGROUP=$userid)";
	mysql_query($query);

	$query="DELETE FROM thesis WHERE AUTHOR IN (SELECT USERID FROM user WHERE USERGROUP=$userid)";
	mysql_query($query);
	
	$query="DELETE FROM user WHERE USERGROUP=$userid OR USERID=$userid";
	mysql_query($query);
	
}
?>